﻿<?php



$conn = unserialize($_SESSION['connexion']);
$q = new ClientQuery();
$client = $q->findOneByEmail($conn->login);

$addr = AdresseQuery::create()->findPk($client->getAdresse());

if($client->getFacturation() == NULL){
	$addrDelivery = $addr;
} else {
	$addrDelivery = AdresseQuery::create()->findPk($client->getFacturation());
}

$client->delete();
$addr->delete();
$addrDelivery->delete();

unset($_SESSION['connexion']);
$smarty->display('account_deleted.tpl');